<template>
    <div class="vuex-view">
        <div style="width: 100px;height: 100px;background-color: red;" @click="aaa"></div>
        <button @click="$store.commit('aa')">logaa</button>
        <button @click="$store.dispatch('bb')">logbb</button>
        <button @click="cc">logcc</button>
        <button @click="chun">纯cookie</button>
        <button v-on:click="qu">取</button>
    </div>
</template>
<script>
import Cookies from 'js-cookie'
export default {


    name: 'VuexView',
    data() {
        return {
            count: ''
        }
    },
    methods: {
        aaa() {
            // this.$store.commit('increment')
            console.log(this.$store.state.data)
            console.log(this.$store.state.ff);

        },
        cc() {
            this.$store.dispatch('bb')
            this.$store.commit('aa')
        },
        chun() {
            Cookies.set('name', 'value', { expires: 7 })
            Cookies.set('age', 'value', { expires: 7 })
            Cookies.set('sex', '17', { expires: 7 })
        },
        qu() {
            console.log(Cookies.get('name'))
            console.log(Cookies.get('age'))
            console.log(Cookies.get('sex'))
        }

    }
}
</script>